New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@trenskow/caseit

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@trenskow/caseit

Small library for converting between different casing.

  • 1.4.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@trenskow/caseit

A small library for changing the case of a string.

Usage

Import using the following example.

const caseit = require('@trenskow/caseit');

– or

import caseit from '@trenskow/caseit'

Converting

To convert from one case type to another use the following example.

const myCamelCase = caseit('my_camel_case', 'camel'); // return 'myCamelCase';

You can convert from any format to any other format. Supported formats are.

  • camel - camelCase
  • pascal - PascalCase
  • snake - snake_case
  • domain - domain.case
  • kebab - kebab-case
  • title - Title Case
  • http - Http-Case

Default format (if omitted) is camel (because it is the Javascript default).

Detecting

To detect the casing of a string do as the following example.

caseit.detect('MyCase'); // returns ['pascal']
caseit.detect('Hello'); // returns ['pascal', 'title', 'http']

Getting the words

You can also get the lowercase variants of all the words in a string by using the following example.

caseit.words('MyCase'); // returns ['my', 'case']

LICENSE

3-Clause BSD (see LICENSE).

Keywords

FAQs

Package last updated on 28 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc